<?php

use Yaf\Application;

header('Access-Control-Allow-Origin:*');
// 响应类型
header('Access-Control-Allow-Methods:POST,GET');
// 带 cookie 的跨域访问
header('Access-Control-Allow-Credentials: true');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,Content-Type,X-CSRF-Token,Authorization');


// [ 应用入口文件 ]
date_default_timezone_set("Asia/Shanghai");
if (!defined('__ROOT__')) {
    $_root = rtrim(dirname(rtrim($_SERVER['SCRIPT_NAME'], '/')), '/');
    define('__ROOT__', (('/' == $_root || '\\' == $_root) ? '' : $_root));
}
error_reporting(E_ALL);
// 定义应用目录
define("APP_PATH", dirname(dirname(__FILE__)));
//define('APPLICATION_PATH', dirname(__DIR__));

$application = new Application( APP_PATH . "/conf/application.ini");

$application->bootstrap()->run();
?>
